package com.example.chirdrenserver.Authority;
import com.example.chirdrenserver.Holder.UserHolder;
import com.example.chirdrenserver.Utils.JwtUtils;
import jakarta.servlet.http.HttpServletRequest;

public class BaseAuthority implements AuthorityVerify {
    @Override
    public Boolean authorityVerify(HttpServletRequest request, String[] permissions) {
        // 获取当前用户权限
        Long uId = (Long) UserHolder.get();
        for (String permission : permissions) {
            if (!AuthorityUtils.verify(uId,permission)) {
                return false;
            }
        }
        return true;
    }
}
